package refactor.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 记录系统中设备设施发生的所有事件
 * </p>
 *
 * @author 杨健
 * @since 2019-08-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class EventLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 主键
     */
    @TableField("module_id")
    private Integer moduleId;

    /**
     * 用于记录事件中相关对应的设备
     */
    @TableField("device_id")
    private Integer deviceId;

    @TableField("facilities_id")
    private Integer facilitiesId;

    /**
     * 事件的执行人
     */
    @TableField("user_id")
    private Integer userId;

    @TableField("fault_type_id")
    private Integer faultTypeId;

    @TableField("type_id")
    private Integer typeId;

    /**
     * 锁通断电地井状态。1：表示有电，0：没电，0：井盖开启、门开启、锁开启。1：表示井盖关闭、门关闭、锁关闭。机房状态：1在线，0掉线
     */
    @TableField("device_status")
    private String deviceStatus;

    /**
     * 1：关门，0：开门
     */
    @TableField("door_status")
    private String doorStatus;

    /**
     * 电量
     */
    @TableField("electricity")
    private String electricity;

    /**
     * 事件处理结果的文字描述0未处理
     */
    @TableField("result")
    private String result;

    /**
     * 时间的发生时间
     */
    @TableField("start_time")
    private Long startTime;

    /**
     * 事件处理完成的期限
     */
    @TableField("end_time")
    private Long endTime;

    /**
     * 存放xml文本用于存放扩展字段
     */
    @TableField("extension")
    private String extension;

    @TableField("flag")
    private String flag;

    public EventLog() {}

    public EventLog(Integer id, Integer modId, Integer deviceId, Integer facilitiesId, Integer userId, Integer faultTypeId, Integer typeId, String devStu, String doorStu, String electricity, String result, Long startTime, Long endTime, String extension, String flag) {
        this.id = id;
        this.moduleId = modId;
        this.deviceId = deviceId;
        this.facilitiesId = facilitiesId;
        this.userId = userId;
        this.faultTypeId = faultTypeId;
        this.typeId = typeId;
        this.deviceStatus = devStu;
        this.doorStatus = doorStu;
        this.electricity = electricity;
        this.result = result;
        this.startTime = startTime;
        this.endTime = endTime;
        this.extension = extension;
        this.flag = flag;
    }
}
